package com.rfid.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import org.apache.log4j.Logger;

import com.rfid.service.RFIDReadInfoService;

/**
 * stop button 监听
 * @author hhf
 */
public class StopListener implements ActionListener {

	private static final Logger log = Logger.getLogger(StopListener.class);
	
	@Override
	public void actionPerformed(ActionEvent e) {
		RFIDReadInfoService service = RFIDReadInfoService.getInstance();
		if(service.getState()) {
			log.debug("线程停止");
			service.stop();
			System.out.println("stop to read ");
		}else {
			log.debug("线程还没有开启");
		}
	}

}
